home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Video.h < prev    next >
Text File  |  1991-05-01  |  7KB  |  191 lines

  1. /************************************************************
  2.  
  3. Created: Sunday, January 6, 1991 at 10:14 PM
  4.     Video.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1986-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __VIDEO__
  15. #define __VIDEO__
  16.  
  17. #ifndef __GEOMETRY__
  18. #include <Geometry.h>
  19. #endif
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     mBaseOffset = 1,            /*Id of mBaseOffset.*/
  29.     mRowBytes = 2,              /*Video sResource parameter Id's */
  30.     mBounds = 3,                /*Video sResource parameter Id's */
  31.     mVersion = 4,               /*Video sResource parameter Id's */
  32.     mHRes = 5,                  /*Video sResource parameter Id's */
  33.     mVRes = 6,                  /*Video sResource parameter Id's */
  34.     mPixelType = 7,             /*Video sResource parameter Id's */
  35.     mPixelSize = 8,             /*Video sResource parameter Id's */
  36.     mCmpCount = 9,              /*Video sResource parameter Id's */
  37.     mCmpSize = 10,              /*Video sResource parameter Id's */
  38.     mPlaneBytes = 11,           /*Video sResource parameter Id's */
  39.     mVertRefRate = 14,          /*Video sResource parameter Id's */
  40.     mVidParams = 1,             /*Video parameter block id.*/
  41.     mTable = 2,                 /*Offset to the table.*/
  42.     mPageCnt = 3,               /*Number of pages*/
  43.     mDevType = 4,               /*Device Type*/
  44.  
  45.     oneBitMode = 128,           /*Id of OneBitMode Parameter list.*/
  46.     twoBitMode = 129,           /*Id of TwoBitMode Parameter list.*/
  47.     fourBitMode = 130,          /*Id of FourBitMode Parameter list.*/
  48.     eightBitMode = 131          /*Id of EightBitMode Parameter list.*/
  49. };
  50. enum {
  51.     sixteenBitMode = 132,       /*Id of SixteenBitMode Parameter list.*/
  52.     thirtyTwoBitMode = 133,     /*Id of ThirtyTwoBitMode Parameter list.*/
  53.  
  54.     firstVidMode = 128,         /*The new, better way to do the above.    */
  55.     secondVidMode = 129,        /*    QuickDraw only supports six video    */
  56.     thirdVidMode = 130,         /*    at this time.                        */
  57.     fourthVidMode = 131,
  58.     fifthVidMode = 132,
  59.     sixthVidMode = 133,
  60.  
  61.     spGammaDir = 64,
  62.     spVidNamesDir = 65,
  63.  
  64. /* Control Codes */
  65.     cscReset = 0,
  66.     cscKillIO = 1,
  67.     cscSetMode = 2,
  68.     cscSetEntries = 3,
  69.     cscSetGamma = 4,
  70.     cscGrayPage = 5,
  71.     cscGrayScreen = 5,
  72.     cscSetGray = 6,
  73.     cscSetInterrupt = 7,
  74.     cscDirectSetEntries = 8
  75. };
  76. enum {
  77.     cscSetDefaultMode = 9,
  78.  
  79. /* Status Codes */
  80.     cscGetMode = 2,
  81.     cscGetEntries = 3,
  82.     cscGetPageCnt = 4,
  83.     cscGetPages = 4,            /* This is what C&D 2 calls it. */
  84.     cscGetPageBase = 5,
  85.     cscGetBaseAddr = 5,         /* This is what C&D 2 calls it. */
  86.     cscGetGray = 6,
  87.     cscGetInterrupt = 7,
  88.     cscGetGamma = 8,
  89.     cscGetDefaultMode = 9
  90. };
  91.  
  92. struct VPBlock {
  93.     long vpBaseOffset;          /*Offset to page zero of video RAM (From minorBaseOS).*/
  94.     short vpRowBytes;           /*Width of each row of video memory.*/
  95.     Rect vpBounds;              /*BoundsRect for the video display (gives dimensions).*/
  96.     short vpVersion;            /*PixelMap version number.*/
  97.     short vpPackType;
  98.     long vpPackSize;
  99.     long vpHRes;                /*Horizontal resolution of the device (pixels per inch).*/
  100.     long vpVRes;                /*Vertical resolution of the device (pixels per inch).*/
  101.     short vpPixelType;          /*Defines the pixel type.*/
  102.     short vpPixelSize;          /*Number of bits in pixel.*/
  103.     short vpCmpCount;           /*Number of components in pixel.*/
  104.     short vpCmpSize;            /*Number of bits per component*/
  105.     long vpPlaneBytes;          /*Offset from one plane to the next.*/
  106. };
  107.  
  108. typedef VPBlock *VPBlockPtr;
  109.  
  110. struct VDEntryRecord {
  111.     Ptr csTable;                /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  112. };
  113.  
  114. typedef struct VDEntryRecord VDEntryRecord;
  115. typedef VDEntryRecord *VDEntRecPtr;
  116.  
  117. /* Parm block for SetGray control call */
  118. struct VDGrayRecord {
  119.     Boolean csMode;             /*Same as GDDevType value (0=mono, 1=color)*/
  120. };
  121.  
  122. typedef struct VDGrayRecord VDGrayRecord;
  123. typedef VDGrayRecord *VDGrayPtr;
  124.  
  125. /* Parm block for SetEntries control call */
  126. struct VDSetEntryRecord {
  127.     ColorSpec *csTable;         /*Pointer to an array of color specs*/
  128.     short csStart;              /*Which spec in array to start with, or -1*/
  129.     short csCount;              /*Number of color spec entries to set*/
  130. };
  131.  
  132. typedef struct VDSetEntryRecord VDSetEntryRecord;
  133. typedef VDSetEntryRecord *VDSetEntryPtr;
  134.  
  135. /* Parm block for SetGamma control call */
  136. struct VDGammaRecord {
  137.     Ptr csGTable;               /*pointer to gamma table*/
  138. };
  139.  
  140. typedef struct VDGammaRecord VDGammaRecord;
  141. typedef VDGammaRecord *VDGamRecPtr;
  142.  
  143. struct VDPageInfo {
  144.     short csMode;               /*(word) mode within device*/
  145.     long csData;                /*(long) data supplied by driver*/
  146.     short csPage;               /*(word) page to switch in*/
  147.     Ptr csBaseAddr;             /*(long) base address of page*/
  148. };
  149.  
  150. typedef struct VDPageInfo VDPageInfo;
  151. typedef VDPageInfo *VDPgInfoPtr;
  152.  
  153. struct VDSizeInfo {
  154.     short csHSize;              /*(word) desired/returned h size*/
  155.     short csHPos;               /*(word) desired/returned h position*/
  156.     short csVSize;              /*(word) desired/returned v size*/
  157.     short csVPos;               /*(word) desired/returned v position*/
  158. };
  159.  
  160. typedef struct VDSizeInfo VDSizeInfo;
  161. typedef VDSizeInfo *VDSzInfoPtr;
  162.  
  163. struct VDSettings {
  164.     short csParamCnt;           /*(word) number of params*/
  165.     short csBrightMax;          /*(word) max brightness*/
  166.     short csBrightDef;          /*(word) default brightness*/
  167.     short csBrightVal;          /*(word) current brightness*/
  168.     short csCntrstMax;          /*(word) max contrast*/
  169.     short csCntrstDef;          /*(word) default contrast*/
  170.     short csCntrstVal;          /*(word) current contrast*/
  171.     short csTintMax;            /*(word) max tint*/
  172.     short csTintDef;            /*(word) default tint*/
  173.     short csTintVal;            /*(word) current tint*/
  174.     short csHueMax;             /*(word) max hue*/
  175.     short csHueDef;             /*(word) default hue*/
  176.     short csHueVal;             /*(word) current hue*/
  177.     short csHorizDef;           /*(word) default horizontal*/
  178.     short csHorizVal;           /*(word) current horizontal*/
  179.     short csHorizMax;           /*(word) max horizontal*/
  180.     short csVertDef;            /*(word) default vertical*/
  181.     short csVertVal;            /*(word) current vertical*/
  182.     short csVertMax;            /*(word) max vertical*/
  183. };
  184.  
  185. typedef struct VDSettings VDSettings;
  186. typedef VDSettings *VDSettingsPtr;
  187.  
  188.  
  189.  
  190. #endif
  191.